package com.zhkj.txg.module.order.entity

import com.chad.library.adapter.base.entity.node.BaseNode
import com.google.gson.annotations.SerializedName
import com.zhkj.lib.http.BaseResponse
import java.io.Serializable

data class OrderListResponse(
    val data: MutableList<OrderListEntity> = mutableListOf()
) : BaseResponse() {
    var hasMore: Boolean = true
    var loadMore: Boolean = false
}

data class OrderListEntity(
    val id: Long,
    @SerializedName("order_sn")
    val orderSignNumber: String = "",
    @SerializedName("order_status")
    var orderStatus: String = "",   // 订单状态:0=待确认,1=已确认,2=已收货,3=已取消,4=已完成
    @SerializedName("shipping_status")
    var shippingStatus: String = "",    // 发货状态:0=未发货,1=已发货
    @SerializedName("pay_status")
    var payStatus: String = "", // 支付状态:0=待支付,1=已支付,2=部分支付,3已退款,4拒绝退款
    val order_type: Int,    //订单类型  10单独购买 20拼团
    val status: Int? = 0,    //拼团状态  0单买 10拼单中 20拼单成功 30拼单失败
    val people: String? = "",    //拼团所需人数
    @SerializedName("order_amount", alternate = ["total_amount"])
    val totalAmount: String? = "",
    @SerializedName("shipping_code")
    val shippingCode: String = "",
    @SerializedName("shipping_no")
    val shippingNo: String = "",
    @SerializedName("total_goods_num")
    var totalNumber: Int = 0,
    @SerializedName("order_goods")
    val goods: MutableList<OrderListGoodsEntity> = mutableListOf(),
    val shops: OrderListShopEntity? = null,
    val share_url: String
)

data class OrderListShopEntity(
    val id: Int,
    @SerializedName("shop_name")
    val shopName: String = "",
    @SerializedName("shop_img")
    val shopImg: String = ""
)

data class OrderListGoodsEntity(
    @SerializedName("goods_id")
    val goodsId: Long,
    @SerializedName("goods_name")
    val goodsName: String = "",
    val image: String = "",
    @SerializedName("goods_num")
    val goodsNum: Int = 0,
    @SerializedName("goods_price")
    val goodsPrice: String = "",
    @SerializedName("spec_key_name")
    val specValue: String = "",
    @SerializedName("share_earn")
    val shareEarn: Double? = 0.0,
    var people: String,    //拼团所需人数
    @SerializedName("refund_status")
    var refundStatus: Int = 0 //售后状态 0=无售后,1=退款中,2=退款成功,3=退款失败,4=换货成功
) : BaseNode(), Serializable {
    var showRefundButton = false
    var isGroup: Boolean = false
    val share_url: String = ""
    override var childNode: MutableList<BaseNode>? = null
}